package com.ctg.payroll2.dao.empadmin.Impl;

import java.io.Serializable;
import java.sql.SQLException;
import java.util.List;
import java.util.Map;


import com.ctg.payroll2.bean.po.CsEmpAccount;
import com.ctg.payroll2.bean.po.PbCity;
import com.ctg.payroll2.bean.po.PbEmployee;
import com.ctg.payroll2.dao.empadmin.EmpAdminIndexDao;
import com.ctg.platform.core.dao.IbatisBaseDao;
import com.ctg.platform.orm.ibatis.IbatisEntityDao;
import com.ibatis.sqlmap.client.SqlMapClient;


public class EmpAdminIndexDaoImpl extends IbatisEntityDao<PbEmployee> implements EmpAdminIndexDao {
	public void delete(List data) throws SQLException {
		SqlMapClient sqlMapClient = this.getSqlMapClient();
		sqlMapClient.startBatch();
		for (int i = 0; i < data.size(); i++) {
			PbEmployee o = (PbEmployee) data.get(i);
			sqlMapClient.delete("PbEmployee.deleteEmployeeById", o.getEmployee_id());	
		}
		sqlMapClient.executeBatch();
	}
	
	public void insertempRoll(CsEmpAccount csEmpAccount) throws SQLException{
		SqlMapClient sqlMapClient = this.getSqlMapClient();
		sqlMapClient.insert("CsEmpAccount.insert", csEmpAccount);
	}
	
	
	public CsEmpAccount queryEmpRoll(Integer empId) throws SQLException{	
		SqlMapClient sqlMapClient = this.getSqlMapClient();
		CsEmpAccount csEmpAccount=(CsEmpAccount) sqlMapClient.queryForObject("CsEmpAccount.selectById", empId);
		return csEmpAccount;
	}
}
